package com.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

//切面类的定义
public class AspectXML {
    public void myBefore(JoinPoint joinPoint) {
        System.out.println("*****前置通知myBefore******织入目标==" + joinPoint.getTarget());
    }
    public void myAfter(JoinPoint joinPoint) {
        System.out.println("*****myAfter******织入目标==" + joinPoint.getTarget());
    }
    public void myAfterReturning(JoinPoint joinPoint) {
        System.out.println("*****后置返回通知myAfterReturning******织入目标==" +
                joinPoint.getSignature().getName());
    }
    public Object myAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        System.out.println("*****环绕通知开始********");
        Object obj = proceedingJoinPoint.proceed();
        System.out.println("*****环绕通知结束");
        return obj;

    }
    public void myException(JoinPoint joinPoint,Throwable e) {
        System.out.println("*****myException******出错信息：" + e.getMessage());
    }
}
